package vehicle;

public class Ship extends Vehicle{
	private double ton;

	public Ship() {
		super();
	}
	public Ship(String name, double speed, double ton) {
		super(name, speed);
		this.ton = ton;
	}
	public double getTon() {
		return ton;
	}
	public void setTon(double ton) {
		this.ton = ton;
	}
	@Override
	public double getReachTime(double distance) {
		System.out.println(ton + "吨位的" + this.getName() + "船速度为" + this.getSpeed()
		    + "海里/小时，到达" + distance + "海里需要" + distance / this.getSpeed() +"小时");
		return distance / this.getSpeed();
	}
}
